package com.example.demo.java8.stream;

import lombok.Data;

import java.util.Objects;

/**
 * Description: <br/>
 *
 * @author liulonglong
 * @taskId <br/>
 * @Date 2019/11/18 10:29
 * @Version 1.0
 */
@Data
public class Student {

    private String name;

    private int age;

    private int stature;

    private SpecialityEnum specialities;

    public Student(String name, int age, int stature) {
        this.name = name;
        this.age = age;
        this.stature = stature;
    }

    @Override public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;
        Student student = (Student) o;
        return age == student.age &&
                stature == student.stature &&
                Objects.equals(name, student.name) &&
                specialities == student.specialities;
    }

    @Override public int hashCode() {
        return Objects.hash(name, age, stature, specialities);
    }
}
